(function(app){
    app
        .controller("contract_other",["$scope","$rootScope","$state","myFactory",'$interval','$stateParams',"$q",'$timeout','$location','$http','$ionicHistory',function($scope,$rootScope,$state,myFactory,$interval,$stateParams,$q,$timeout,$location,$http,$ionicHistory){
			var token=sessionStorage.getItem("token");
        	$scope.$on('$stateChangeSucess',function(){
        		console.log("返回该页面的时候重新加载了");
        	});
        
        	//参数定义、接收
        	$scope.change=false;//是否修改了信息
            
        	//是否只读
        	$scope.accountNameFlag=false; //账户名称
        	$scope.mobileFlag=false;    //手机号码
        	$scope.accountNoFlag =false; //客户账号
            $scope.idNoFlag =false; //开户证件号码	
            $scope.idTypeFlag =false;   //证件类型
            $scope.bankCodeFlag =false; //开户银行
            $scope.accountTypeFlag = false; //账户类型
            $scope.sigleLimitAmountFlag = false; //单笔签约金额限制
            $scope.insPremPyfPrdNumFlag = false; //授权期限
            $scope.collectRateFlag = false;//代收频率
            //S2022032221693-农业银行客户签约补充需求 add by huanghaokun 20211214 start
            $scope.effectDateFlag = true;//授权起始日期
            $scope.dueDateFlag = true;//授权终止日期
            $scope.dayLimitAmountFlag = true;//付款日累计限额
            //S2022032221693-农业银行客户签约补充需求 add by huanghaokun 20211214 end
            
            //是否为空
            $scope.accountNameNeed=false; //账户名称
        	$scope.mobileNeed=false;    //手机号码
        	$scope.accountNoNeed =false; //客户账号
            $scope.idNoNeed =false; //开户证件号码	
            $scope.idTypeNeed =false;   //证件类型
            $scope.bankCodeNeed =false; //开户银行
            $scope.accountTypeNeed = false; //账户类型
            $scope.sigleLimitAmountNeed = false; //单笔签约金额限制
            $scope.insPremPyfPrdNumNeed = false; //授权期限
            $scope.collectRateNeed = false;//代收频率
            //S2022032221693-农业银行客户签约补充需求 add by huanghaokun 20211214 start
            $scope.effectDateNeed = true;//授权起始日期
            $scope.dueDateNeed = true;//授权终止日期
            $scope.dayLimitAmountNeed = true;//付款日累计限额
            //S2022032221693-农业银行客户签约补充需求 add by huanghaokun 20211214 end
            
            //是否显示
            $scope.accountNameShow=false; //账户名称
        	$scope.mobileShow=false;    //手机号码
        	$scope.accountNoShow =false; //客户账号
            $scope.idNoShow =false; //开户证件号码	
            $scope.idTypeShow =false;   //证件类型
            $scope.bankCodeShow =false; //开户银行
            $scope.accountTypeShow = false; //账户类型
            $scope.sigleLimitAmountShow = false; //单笔签约金额限制
            $scope.insPremPyfPrdNumShow = false; //授权期限
            $scope.collectRateShow = false;//代收频率
            //S2022032221693-农业银行客户签约补充需求 add by huanghaokun 20211214 start
            $scope.effectDateShow = false;//授权起始日期
            $scope.dueDateShow = false;//授权终止日期
            $scope.dayLimitAmountShow = false;//付款日累计限额
            //S2022032221693-农业银行客户签约补充需求 add by huanghaokun 20211214 end
            
            //是否有效
            $scope.idTypeNameDisabled = false;
            $scope.bankcodeDisabled = false;
            $scope.accountTypeDisabled = false;
            $scope.sendDisabled = false;//验证码
            
            $scope.accountCollectCopy=""; //
            $scope.data = {
                msg: {
                    timeCon: '获取手机验证码',
                    textFlag: true,
                    timeSign: null
                },
                flag:false//是否勾选了阅读
            };
            //监控值是否被改变
            $scope.inputDataChange= function(){
            	$scope.change=true;
            }
            
            //证件类型
            $scope.idTypeLF=[
                {value:'0',text:'身份证'},
                {value:'1',text:'户口簿'},
                {value:'2',text:'护照'},
                {value:'3',text:'军官证'},
                {value:'4',text:'士兵证'},
                {value:'5',text:'港澳居民来往内地通行证'},
                {value:'6',text:'台湾同胞来往内地通行证'},
                {value:'7',text:'临时身份证'},
                {value:'8',text:'外国人居留证'},
                {value:'9',text:'警官证'},
                {value:'10',text:'营业执照'},
                {value:'11',text:'组织机构代码证'},
                {value:'12',text:'税务登记证'},
                {value:'13',text:'统一社会信用代码证'},
                {value:'X',text:'其他证件'}
            ];
            $scope.payCompany=[
            	{code:'01',name:'中信直连'},
            	{code:'53',name:'广州银联网络支付有限公司'},
            	{code:'54',name:'支付宝'},
            	{code:'59',name:'通联支付网络服务股份有限公司'},
            	{code:'GD',name:'大广东银结通'},
            	{code:'BR',name:'保融'}
            ]
            $scope.bankTypeList=[
                {banktypecode:'00',banktypedesc:'银行卡'},
                {banktypecode:'01',banktypedesc:'存折'},
                {banktypecode:'02',banktypedesc:'信用卡'}
             
            ];
            
            //传值
            var contractItem = $stateParams.contractItem
            
            var authorizedAmt = contractItem.authorizedAmt;//授权金额
            var paymentDeadline = contractItem.paymentDeadline;//缴费截止日期
            var paymentTimes = contractItem.paymentTimes;//缴费次数
            var resultSign = contractItem.resultSign;//签约查询返回码
            var currentAmount = contractItem.currentAmount;//当前期缴保费
            
            var nowDate1 = new Date();
            var nowYear1=nowDate1.getFullYear();//当前年
            var nowMonth1=nowDate1.getMonth()+1;//当前月
            nowMonth1 = nowMonth1 < 10 ? '0' + nowMonth1 : nowMonth1;
            var nowDay1=nowDate1.getDate() < 10 ? '0' + nowDate1.getDate() : nowDate1.getDate();//当前日
    		var startTime1=nowYear1 +  nowMonth1 + nowDay1;//开始日期
    		$scope.accountStartTime=startTime1;
    		console.log("该银行的付款单笔限额是："+contractItem.sigleLimitAmount);
    		console.log("该银行的付款日累计限额是："+contractItem.dayLimitAmount);
    		console.log("该银行的付款月累计限额是："+contractItem.monthLimitAmount);
    		console.log("该银行的委托失效日期是："+contractItem.dueDate);
            $scope.account =  {
        			accountNo:contractItem.accountNo,	
        			idType:contractItem.idType,//身份类型
        			idNo:contractItem.idNum,//身份号码
                    accountName :contractItem.userName,//姓名
                    mobile:'',//手机号码
                    BankCode:contractItem.BankCode,//银行编号
                    accountType:contractItem.accountType,//银行卡类型
                    period:'',
                    signBusType:'',
                    code:'',//测试验证码
                    vailddate : contractItem.vailddate == null?'':contractItem.vailddate,
                    cvv2 : contractItem.cvv2 ==null ?'':contractItem.cvv2,
                    dueDate: contractItem.dueDate,
                    //dueDate: "20991231",
                    sigleLimitAmount:contractItem.sigleLimitAmount,
                    dayLimitAmount:contractItem.dayLimitAmount,
                    monthLimitAmount:contractItem.monthLimitAmount,
                    authorizedAmt:authorizedAmt,//授权金额
                    paymentDeadline:paymentDeadline,//缴费截止日期
                    paymentTimes:paymentTimes,//缴费次数
                    insPolcyNo:contractItem.items.chdrnum01,
                    /*去除农行签约编号 add by huanghaokun 20210524 start*/
                    //contractNo:'',
                    /*去除农行签约编号 add by huanghaokun 20210524 end*/
                    //cvrNm:contractItem.cvrNm,
                    effectDate :'',
                    areaCode:'',
                    insPremPyfPrdNum:'',
                    collectRate:'',
                    bankAccountName:contractItem.bankAccountName
        	};
            
            //S2022032221693-农业银行客户签约补充需求 add by huanghaokun 20211214 start
            //显示授权书
           /* //$scope.otherBankFlag = false;
            $scope.abocBankFlag = false;
            if ($scope.account.BankCode== '05') {
            	$scope.abocBankFlag = true;
            } else{
            	$scope.otherBankFlag = true;
            }*/
            //S2022032221693-农业银行客户签约补充需求 add by huanghaokun 20211214 end
            
            var nextAction = contractItem.nextAction;//执行的下一步
            var items = contractItem.items;//从上一步获取传递过来的所有参数
            var chdrnum01 = items['chdrnum01'];
            $scope.chdrnum01 = chdrnum01;
            var flag = contractItem.flag;//判断从那个上一步过来的
        	$rootScope['flag'] = flag;
        	
			var payRequestTime=3;//查询支付接口次数限制
			var payRequestPerTime=10000;//每次调用间隔时间：10s
			
            var accountNo = $scope.account.accountNo;
            var itemId =  contractItem.itemId;
            $scope.AgreeDesc = "中信保诚人寿保险有限公司";
            $scope.AgreePayCompany= "广州银联网络支付有限公司 / 通联支付网络服务股份有限公司";
            var payCompanyCOde = contractItem.agreePayCompanyCode;
            
            for(var k = 0 ; k <  $scope.payCompany.length ;k++ ){
            	if ( $scope.payCompany[k].code == payCompanyCOde){
            		  $scope.AgreePayCompany =$scope.payCompany[k].name;
            		  break;
            	}
            }
           
            var countNum = 0;
            $("#BankForItem0201Input").val(contractItem.BankName);//银行名称
            if (contractItem.BankName.indexOf("(") >0){
            	$scope.bankdesc = contractItem.BankName.substring(0,contractItem.BankName.indexOf("("));
            }else {
            	$scope.bankdesc = contractItem.BankName;
            };//银行名称
            var maxTime=180;//10;//180
            var timeOutSign="N";
            var idTypeName = '';//证件类型名称
            var openBankName = $scope.bankdesc;//开户行
            
            $scope.load = function () {
                myFactory.loadingShow();//显示加载圈
                console.log("初始化加载");
              //S2022032221693-农业银行客户签约补充需求 add by huanghaokun 20211214 start
                /*if ($scope.account.BankCode== '05') {
                	$scope.abocBankFlag = true;
                	//S2022032221693-农业银行客户签约补充需求 add by huanghaokun 20211214 start
                    $scope.effectDateShow = true;//授权起始日期
                    $scope.dueDateShow = true;//授权终止日期
                    $scope.dayLimitAmountShow = true;//付款日累计限额 
                    var effectDate = nowYear1.toString() +  nowMonth1.toString() + nowDay1.toString();
                    $scope.account.effectDate = effectDate;
                  
                } else{
                	$scope.otherBankFlag = true;
                }*/
              //S2022032221693-农业银行客户签约补充需求 add by huanghaokun 20211214 end
                for(var i=0 ; i<$scope.idTypeLF.length ; i++){
                    if( $scope.idTypeLF[i].value=== contractItem.idType ){
                        $scope.idTypeInputItem = $scope.idTypeLF[i].text;//证件类型
                        $scope.contractZxInfo.idTypeName = $scope.idTypeLF[i].text;//证件类型名称
                        break;
                    }
                }
                for ( var j = 0 ; j < $scope.bankTypeList.length ; j++ ){
                	if($scope.bankTypeList[j].banktypecode == contractItem.accountType ){
                		//$('#accountTypeInput').val($scope.bankTypeList[j].banktypedesc);
                		$scope.accountTypeInput = $scope.bankTypeList[j].banktypedesc;
                		break;
                	}
                }
                var token = sessionStorage.getItem("token");
                var timestamp = myFactory.getTimetamp();
                var sfis = "token-timestamp";
                var signStr = "token=" + token + "&timestamp=" + timestamp;
                var sign = myFactory.hex(signStr);
                $http({
                    method: 'GET',
                    url: app.domain + 'contract/getPaymentChannelFieldList.action',
                    params: { 
                        'sign': sign, 'sfis': sfis, 'token': token, 'timestamp': timestamp, 'bankCode':contractItem.BankCode
                    }
                }).then(function(response){
                    
                    var accountCollect=response.data.fieldList;
                    $scope.accountCollectCopy=accountCollect;
                    
                    	for(var i=0;i<accountCollect.length;i++){
                    	   if(accountCollect[i].fieldCode=='accountName'){
                    		   $scope.accountNameShow = true;
                    		   if(accountCollect[i].isReadOnly == 'Y'){
                    			   $scope.accountNameFlag=true;
                        		   $("#accountNameBGShow").css("background-color","#ECEBEA");
                    		   }else{
                    			   $scope.accountNameFlag=false;
                    		   }
                    		   if(accountCollect[i].isNull  == 'N'){
                    			   $scope.accountNameNeed=true;
                    		   }
                    	   }
                    	   if(accountCollect[i].fieldCode=='mobile'){
                    		   $scope.mobileShow = true;
	                    	   if(accountCollect[i].isReadOnly == 'Y'){
	                			   $scope.mobileFlag=true;
	                			   $("#mobileBGShow").css("background-color","#ECEBEA"); //背景
	                		   }else{
                    			   $scope.mobileFlag=false;
                    		   }
	                    	   if(accountCollect[i].isNull == 'N'){
                    			   $scope.mobileNeed=true;
                    		   }
                    	   }
                    	   if(accountCollect[i].fieldCode=='accountNo'){
                    		   $scope.accountNoShow = true;
	                    	   if(accountCollect[i].isReadOnly == 'Y'){
	                			   $scope.accountNoFlag=true;  //只读状态
	                			   $("#accountNoBGShow").css("background-color","#ECEBEA"); //背景
	                		   }else{
                    			   $scope.accountNoFlag=false;
                    		   }
	                    	   if(accountCollect[i].isNull == 'N'){
                    			   $scope.accountNoNeed=true;
                    		   }
                    	   }
                    	   if(accountCollect[i].fieldCode=='idNo'){
                    		   $scope.idNoShow = true;
	                    	   if(accountCollect[i].isReadOnly == 'Y'){
	                			   $scope.idNoFlag=true;
	                			   $("#idNoBGShow").css("background-color","#ECEBEA"); //背景
	                		   }else{
                    			   $scope.idNoFlag=false;
                    		   }
	                    	   if(accountCollect[i].isNull == 'N'){
                    			   $scope.idNoNeed=true;
                    		   }
                    	   }
                    	   if(accountCollect[i].fieldCode=='idType'){
                    		   $scope.idTypeShow = true;
	                    	   if(accountCollect[i].isReadOnly == 'Y'){
	                			   $scope.idTypeFlag=true;
	                			   $("#idTypeBGShow").css("background-color","#ECEBEA"); //背景
	                			   //$("#idTypeName").attr("disabled","disabled");
	                			   $scope.idTypeNameDisabled = true;
	                		   }else{
                    			   $scope.idTypeFlag=false;
                    			   //$("#idTypeName").removeAttr("disabled");
                    			   $scope.idTypeNameDisabled = false;
                    		   }
	                    	   if(accountCollect[i].isNull == 'N'){
                    			   $scope.idTypeNeed=true;
                    		   }
                    	   }
                    	   if(accountCollect[i].fieldCode=='bankCode'){  //开户银行
                    		   $scope.bankCodeShow = true;
	                    	   if(accountCollect[i].isReadOnly == 'Y'){
	                			   $scope.bankCodeFlag=true;
	                			   $("#bankCodeBGShow").css("background-color","#ECEBEA");
	                			   $scope.bankcodeDisabled = true;
	                		   }else{
                    			   $scope.bankCodeFlag=false;
                    			   $scope.bankcodeDisabled = false;
                    		   }
	                    	   if(accountCollect[i].isNull == 'N'){
                    			   $scope.bankCodeNeed=true;
                    		   }
                    	   }
                    	   if(accountCollect[i].fieldCode=='accountType'){  //银行卡类型
                    		   $scope.accountTypeShow = true;
	                    	   if(accountCollect[i].isReadOnly == 'Y'){
	                			   $scope.accountTypeFlag=true;
	                			   $("#accountTypeBGShow").css("background-color","#ECEBEA");
	                			   $scope.accountTypeDisabled = true;
	                		   }else{
                    			   $scope.accountTypeFlag=false;
                    			   $scope.accountTypeDisabled = false;
                    		   }
	                    	   if(accountCollect[i].isNull == 'N'){
                    			   $scope.accountTypeNeed=true;
                    		   }
                    	   }
                    	   if(accountCollect[i].fieldCode=='sigleLimitAmount'){ //单笔签约金额限制
                    		   $scope.sigleLimitAmountShow = true;
	                    	   if(accountCollect[i].isReadOnly == 'Y'){
	                			   $scope.sigleLimitAmountFlag=true;
	                			   $("#sigleLimitAmountBGShow").css("background-color","#ECEBEA");
	                		   }else{
                    			   $scope.sigleLimitAmountFlag=false;
                    		   }
	                    	   if(accountCollect[i].isNull == 'N'){
                    			   $scope.sigleLimitAmountNeed=true;
                    		   }
                    	   }
                    	   if(accountCollect[i].fieldCode=='insPremPyfPrdNum'){  //授权期限
                    		   $scope.insPremPyfPrdNumShow = true;
	                    	   if(accountCollect[i].isReadOnly == 'Y'){
	                			   $scope.insPremPyfPrdNumFlag=true;
	                			   $("#insPremPyfPrdNumBGShow").css("background-color","#ECEBEA");
	                			   $("#insPremPyfPrdNum").val("999个月");//默认999个月
	                		   }else{
                    			   $scope.insPremPyfPrdNumFlag=false;
                    		   }
	                    	   if(accountCollect[i].isNull == 'N'){
                    			   $scope.insPremPyfPrdNumNeed=true;
                    		   }
                    	   }
                    	   if(accountCollect[i].fieldCode=='collectRate'){//代收频率
                        	   $scope.collectRateShow = true;
	                    	   if(accountCollect[i].isReadOnly == 'Y'){
	                			   $scope.collectRateFlag=true;
	                			   $("#collectRateBGShow").css("background-color","#ECEBEA");
	                			   $("#collectRate").val("999笔/月");//默认999笔/月
	                		   }else{
                    			   $scope.collectRateFlag=false;
                    		   }
	                    	   if(accountCollect[i].isNull == 'N'){
                    			   $scope.collectRateNeed=true;
                    		   }
                           }
                    	   /*S2022032221693-农业银行客户签约补充需求 add by huanghaokun 20211214 start*/
                    	   if(accountCollect[i].fieldCode=='effectDate'){//授权起始日期
                        	   $scope.effectDateShow = true;
                        	   var effectDate = nowYear1.toString() +  nowMonth1.toString() + nowDay1.toString();
                               $scope.account.effectDate = effectDate;
	                    	   if(accountCollect[i].isReadOnly == 'Y'){
	                			   $scope.effectDateFlag=true;
	                			   $("#effectDateBGShow").css("background-color","#ECEBEA");
	                    	   }else{
                    			   $scope.effectDateFlag=false;
                    		   }
	                    	   if(accountCollect[i].isNull == 'N'){
                    			   $scope.effectDateNeed=true;
                    		   }
                           }
                    	   if(accountCollect[i].fieldCode=='dueDate'){//授权终止日期
                        	   $scope.dueDateShow = true;
	                    	   if(accountCollect[i].isReadOnly == 'Y'){
	                			   $scope.dueDateFlag=true;
	                			   $("#dueDateBGShow").css("background-color","#ECEBEA");
	                    	   }else{
                    			   $scope.dueDateFlag=false;
                    		   }
	                    	   if(accountCollect[i].isNull == 'N'){
                    			   $scope.dueDateNeed=true;
                    		   }
                           }
                    	   if(accountCollect[i].fieldCode=='dayLimitAmount'){//付款日累计限额
                        	   $scope.dayLimitAmountShow = true;
	                    	   if(accountCollect[i].isReadOnly == 'Y'){
	                			   $scope.dayLimitAmountFlag=true;
	                			   $("#dayLimitAmountBGShow").css("background-color","#ECEBEA");
	                    	   }else{
                    			   $scope.dayLimitAmountFlag=false;
                    		   }
	                    	   if(accountCollect[i].isNull == 'N'){
                    			   $scope.dayLimitAmountNeed=true;
                    		   }
                           }
                    	   /*S2022032221693-农业银行客户签约补充需求 add by huanghaokun 20211214 end*/
                    	   
                    	}
                    
                	 myFactory.loadingHide();
                     //弹框提示只能是银行卡目前
                }, function(response){
                	 myFactory.loadingHide();
                     //弹框提示只能是银行卡目前
                });
               
            };
     	   /*S2022032221693-农业银行客户签约补充需求 add by huanghaokun 20211214 start*/
            /*if(contractItem.BankCode =='05'){
                $scope.yjFlag = true;
            }*/
     	   /*S2022032221693-农业银行客户签约补充需求 add by huanghaokun 20211214 end*/

            $scope.certNumFlag =false;
            //获取手机验证码
            $scope.getValidateNum = function(){
            	
            	if( $scope.account.mobile == '' ){
            		myFactory.alert('提示','请输入手机号码!');
            		return;
            	}
            	//S2022032221693-农业银行客户签约补充需求 add by huanghaokun 20220509 start
            	/*if ($scope.account.BankCode == '05') {//农业银行
            		if($scope.account.idType!='0'){
            			myFactory.alert('提示','证件类型只能为身份证!');
            			return;
            		}
            	}*/
            	//S2022032221693-农业银行客户签约补充需求 add by huanghaokun 20220509 end
            	myFactory.loadingShow();
            	  $scope.startSignIterval();
            	  $scope.change = false;
	            	var signMode = '00';//签约申请
	            	var signMoney = '0';//签约金额默认填写0
	            	var signTotalMoney = '0';//签约总金额默认填写0
	            	var pyfCodt = '';//签约缴费截止日期
	            	/*S2023011824901-官微授权银行页面超限额无拦截、非签约银行进入签约页面问题 add by huanghk 20230216 start*/
	            	if(contractItem.signMoney!="" && contractItem.signMoney!=undefined){
	                	signMoney = contractItem.signMoney;
	                }
	                /*S2023011824901-官微授权银行页面超限额无拦截、非签约银行进入签约页面问题 add by huanghk 20230216 end*/
	                //S2023103027791个人养老年金项目保全系统优化需求 update by huanghk 20231127 start
	            	myFactory.goContract($scope.account.accountNo,$scope.account.accountName,$scope.account.accountType,$scope.account.BankCode,
	            			$scope.account.mobile,'',signMode,contractItem.isReal,contractItem.branch,signMoney, $scope.account.idType,
	            			$scope.account.idNo,$scope.account.vailddate,$scope.account.cvv2,
	            			$scope.account.sigleLimitAmount, $scope.account.dayLimitAmount, $scope.account.monthLimitAmount, $scope.account.dueDate, 
	            			successCall,errorCall,chdrnum01, itemId, $scope.account.insPremPyfPrdNum, pyfCodt, signTotalMoney,
	            			/*去除农行签约编号 add by huanghaokun 20210524 start*/
	            			/*$scope.account.contractNo, */
            				/*去除农行签约编号 add by huanghaokun 20210524 end*/
	            			$scope.account.effectDate, $scope.account.period, $scope.account.signBusType, $scope.account.areaCode,'');
            		//S2023103027791个人养老年金项目保全系统优化需求 update by huanghk 20231127 end
            };
            function successCall(response){
            	myFactory.loadingHide();
                if (response.data.resultCode ==='R01'){
                /*去除农行签约编号 add by huanghaokun 20210524 start*/
                	/*if ($scope.account.BankCode == '05') {//农业银行
                		console.log("农行的签约编号是："+response.data.contractNo);
                		$("#contractNo").val(response.data.contractNo);
                		$scope.account.contractNo = response.data.contractNo;
                	}*/
                /*去除农行签约编号 add by huanghaokun 20210524 end*/
                    myFactory.alert("提示","验证码已发送成功！"); 
                }else
                {
                 myFactory.alert("提示", response.data.resultMsg);
                 /**********计时器结束处理begin**************/
                 //提交后台之前，首先停止倒计时，并且还原成可以重新获取验证码状态
                 $scope.data.msg.timeCon = "获取手机验证码";
                 $scope.data.msg.textFlag = true;
                 $interval.cancel($scope.data.msg.timeSign); //立即终止倒计时,避免出现滚动条转动的时候已经到时间临界点
                 timeOutSign = "Y"; //手动让当前验证码超时，让用户重新获取一次验证码
                 $('#send').css('background-color','red');
                 $scope.sendDisabled = false;
                 /***********计时器结束处理end**************/
                }
            }
            function errorCall(response){
               	myFactory.loadingHide();
                myFactory.alert('失败','请稍后重试');
            }
            //手机验证码倒计时180秒
            $scope.startSignIterval = function(){
                $('#send').css('background-color','lightgray');
                $scope.sendDisabled = true;
                maxTime=120;//10;//180
                timeOutSign="N";
                $scope.data.msg.textFlag = false;
                $scope.data.msg.timeCon = "有效期："+maxTime+"s";
                $scope.data.msg.timeSign = $interval(function(){
                    maxTime--;
                    if (maxTime < 1) {
                        $scope.data.msg.timeCon = "获取手机验证码";
                        $scope.data.msg.textFlag = true;
                        $interval.cancel($scope.data.msg.timeSign);
                    } else {
                        $scope.data.msg.timeCon = "有效期："+maxTime+"S";
                    }
                    if(maxTime==0){
                        timeOutSign="Y";
                        $('#send').css('background-color','red');
                        $scope.sendDisabled = false;
                        return false;
                    }
                }, 1000);
            };
            //客户须知弹框
           /* $scope.tipOpen = function(){
                modal('open','contract_model','overwindow_contract');
            };*/
            //身份证明弹框
            $scope.idTypeChoose = function() {
                var options =$("#idTypeName option:selected");
                $scope.account.idType = options.val();
                $("#idTypeInputItem").val(options.text());
                $scope.contractZxInfo.idTypeName = options.text();
                $scope.change=true;
            };
            //银行选择弹框
            $scope.bankChoose = function () {//点选之后把银行代码以及名字传送过来
                var options =$("#bankcodeSelect option:selected");
                $scope.account.BankCode = options.val();
                $("#bankcodeInput").val(options.text());
                openBankName = options.text();
            };
            //银行卡类型选择弹框
            $scope.bankTypeChoose = function (){
                var options =$("#accountTypeSelect option:selected");
                if (options.val() === '02'){ //为信用卡，则显示信用卡必填项
                    $('#showBankType').show();
                } else {
                    $('#showBankType').hide();
                }
                $scope.account.accountType = options.val();
                //$("#accountTypeInput").val(options.text());
                $scope.accountTypeInput = options.text();
            };
            $scope.tipClose = function(){
                modal('close','contract_model','overwindow_contract');
            };
            //关闭遮罩
            $scope.overwindowClose = function(){
                $(".overwindow").hide();
                $(".overmodal").hide();
            };
            
            //中信银行个人客户委托代收业务授权书弹窗
            $scope.citicTipClose = function(){
	       		modal('close','contract_citic_model','overwindow_contract');
	       	};
            
	       	//中信银行个人客户委托代收业务授权书弹窗
            $scope.citicTipOpen = function(){
            	modal('open','contract_citic_model','overwindow_contract');
            };
            
            
            $scope.abocTipOpen = function(){
            	modal('open','contract_aboc_model','overwindow_contract');
            };
            
            $scope.abocTipClose = function(){
            	modal('close','contract_aboc_model','overwindow_contract');
            };
            
            //S2022102124053营运系统增加隐私政策需求 add by huanghk 20230203 start
            $scope.customerInfoOpen = function(){
            	modal('open','customerInfo_model','overwindow_contract');
            };
            
            $scope.customerInfoClose = function(){
            	modal('close','customerInfo_model','overwindow_contract');
            };
            $scope.privacyOpen = function(){ 
				$state.go('privacy', {
                    itemId: itemId,
                    chdrnum01: chdrnum01,
                    chdrcoy: items['chdrcoy']
                });
			}
            //S2022102124053营运系统增加隐私政策需求 add by huanghk 20230203 end
            
            var nowDate = new Date();
            var nowYear=nowDate.getFullYear();//当前年
            var nowMonth=nowDate.getMonth()+1;//当前月
            nowMonth = nowMonth < 10 ? '0' + nowMonth : nowMonth;
            var nowDay=nowDate.getDate() < 10 ? '0' + nowDate.getDate() : nowDate.getDate();//当前日
            var nowHour=nowDate.getHours() < 10 ? '0' + nowDate.getHours() : nowDate.getHours();//当前时
            var nowSeonds=nowDate.getMinutes() < 10 ? '0' + nowDate.getMinutes() : nowDate.getMinutes();//当前分
            var nowMilliseconds=nowDate.getSeconds() < 10 ? '0' + nowDate.getSeconds() : nowDate.getSeconds();//当前秒
            var deadlineStartTime=nowYear + '-' + nowMonth + '-' + nowDate.getDate();//授权期限
            var deadlineEndTime='2099-12-31';//授权期限
            
            $scope.contractZxInfo={
        		/*accountName:'',//账户名
        		accountNum:'',//账户号
        		idType:'',//证件类型
        		idNum:'',//证件号码*/
           		openBankName:openBankName,//开户行
           		idTypeName:idTypeName,//证件类型名称
        		deadlineStartTime:deadlineStartTime,//授权期限
        		deadlineEndTime:deadlineEndTime,//授权期限
        		nowYear:nowYear,//当前年
        		nowMonth:nowMonth,//当前月
        		nowDay:nowDay,//当前日
        		nowHour:nowHour,//当前时
        		nowSeonds:nowSeonds,//当前分
        		nowMilliseconds:nowMilliseconds, //当前秒
        		/*sigleLimitAmount:'',//付款单笔限额
        		dayLimitAmount:'',//付款日累计限额
        		monthLimitAmount:'' //付款月累计限额*/
                authorizedAmt:authorizedAmt,//授权金额
                paymentDeadline:paymentDeadline,//缴费截止日期
                paymentTimes:paymentTimes,//缴费次数
                //limitPer:limitPer//每期扣款限额
            };
            
            //返回
            $scope.goBack=function(){
        		$rootScope['flag'] ='';
                myFactory.goBack();
            };
            
          //验证输入金额是否是数字或者两位小数或者一位小数整数，且大于当前期缴保费
          function checkAmount(value, minAmount) {
        	  var amtreg=/^\d+(\.\d{1,2})?$/;
        	  if(amtreg.test(value) && parseFloat(value) >= parseFloat(minAmount)){
        		  return true;
        	  }
        	  return false;
          }
            
          //判断是否为大于等于1的正整数
          function checkInteger(value) {
        	  if ('' != value) {
        		  var r = /^\+?[1-9][0-9]*$/;
        		  if (r.test(value)) {
        			  if (value >= 1 && parseInt(value) >= parseInt(paymentTimes)) {
        				  return true;
        			  }
        		  }
        	  }
        	  return false;
          }
          
          //校验输入的日期是否为YYYMMDD且大于当前日期
          function checkDate(value) {
        	  var dateFormat =/^(\d{4})(\d{2})(\d{2})$/;
          	  if (dateFormat.test(value)) {
          		  var time = new Date(value.substr(0,4) + "/" + value.substr(4,2) + "/" + value.substr(6,2)).valueOf();
          		  var nowDate = new Date();
          		  var nowYear=nowDate.getFullYear();//当前年
	              var nowMonth=nowDate.getMonth()+1;//当前月
	              nowMonth = nowMonth < 10 ? '0' + nowMonth : nowMonth;
	              var nowDay=nowDate.getDate() < 10 ? '0' + nowDate.getDate() : nowDate.getDate();//当前日
	              var myDate = new Date(nowYear + "/" + nowMonth + "/" + nowDay).valueOf();
          		  if(time > myDate) {
          			  return true;
          		  }
          	  }
          	  return false;
          }
          
            //提交
            $scope.submit = function(){
            	if (countNum >= 3 ){
            		myFactory.alert('警告','该账号签约次数已达到三次，请联系系统管理员!');
            		return;
            	}
            	//校验
            	if( $scope.account.mobile == '' ){
            		myFactory.alert('提示','请输入手机号码!');
            		return;
            	}
            	//校验
            	if( $scope.account.code == '' ){
            		myFactory.alert('提示','请输入手机验证码!');
            		return;
            	}
            	
            	for(var i=0;i<$scope.accountCollectCopy.length;i++){
                    var value=$scope.accountCollectCopy[i].fieldCode;
                    //idType,
                    if(value == 'idType'&& $scope.accountCollectCopy[i].isNull == 'N'){
                    	if($("#idTypeInputItem").val()==''||$("#idTypeInputItem").val()==''){
                    		myFactory.alert('提示！',"请务必填写完毕所有栏目！");
                            myFactory.loadingHide();
                    		return;
                    	}
                    }
                    //accountType
                    if(value=='accountType'){
                    	if(($("#accountTypeInput").val()==''||$("#accountTypeInput").val()=='')&& $scope.accountCollectCopy[i].isNull == 'N'){
                    		myFactory.alert('提示！',"请务必填写完毕所有栏目！");
                            myFactory.loadingHide();
                    		return;
                    	}
                    }
                    //为空 同时 必填
                    if(value != "idType" &&  value!="accountType" && value!="mobile" && value!="bankCode" /*&&value!="verifyCode" && value!='period' && value!='signBusType'*/){
	                    if(($("#"+value).val() == '' || $("#"+value).val() == null) && $scope.accountCollectCopy[i].isNull == 'N'){
	                    	myFactory.alert('提示！',"请务必填写完毕所有栏目！");
	                        myFactory.loadingHide();
	                		return;
	                    }
                    }
            	}
                myFactory.loadingShow();
                /*S2022032221693-农业银行客户签约补充需求 add by huanghaokun 20220421 start*/
                /*if ( !$scope.data.flag  && $scope.account.BankCode== '05'){
                	myFactory.alert("提示！","请阅读并勾选协议！");
                	myFactory.loadingHide();
                	return;
                }*/
                /*S2022032221693-农业银行客户签约补充需求 add by huanghaokun 20220421 end*/
                /*S2022102124053营运系统增加隐私政策需求 add by huanghk 20230203 start*/
                if ( !$scope.data.flag01 ){
                	myFactory.alert("提示！","请阅读并勾选协议！");
                	myFactory.loadingHide();
                	return;
                }
                /*S2022102124053营运系统增加隐私政策需求 add by huanghk 20230203 end*/
                if ( timeOutSign == 'Y'){
                    myFactory.alert('提示！','验证码已过期，请重新获取');
                    myFactory.loadingHide();
                    return;
                }
                //判断获取验证码后是否进行了修改操作，是的话，弹框提示，并不允许执行签约
                if( $scope.change ){
                	myFactory.loadingHide();
                	myFactory.alert("","由于您修改了签约数据，短信验证码已失效，请重新获取短信验证码","info");
                	return ;
                }
                
                var signMode = '01';//签约确认
                var signMoney = '0';//签约金额默认填写0
                var signTotalMoney = '0';//签约总金额默认填写0
                var pyfCodt = '';//签约缴费截止日期
                /*S2023011824901-官微授权银行页面超限额无拦截、非签约银行进入签约页面问题 add by huanghk 20230216 start*/
                if(contractItem.signMoney!="" && contractItem.signMoney!=undefined){
                	signMoney = contractItem.signMoney;
                }
                /*S2023011824901-官微授权银行页面超限额无拦截、非签约银行进入签约页面问题 add by huanghk 20230216 end*/
                //S2023103027791个人养老年金项目保全系统优化需求 update by huanghk 20231127 start
                myFactory.goContract($scope.account.accountNo,$scope.account.accountName,$scope.account.accountType,$scope.account.BankCode,
                		$scope.account.mobile,$scope.account.code,signMode,contractItem.isReal, contractItem.branch,signMoney,
                		$scope.account.idType,$scope.account.idNo,$scope.account.vailddate,$scope.account.cvv2,
                		$scope.account.sigleLimitAmount, $scope.account.dayLimitAmount, $scope.account.monthLimitAmount, 
                		$scope.account.dueDate,successCallContract,errorCallContract,
                		chdrnum01, itemId, $scope.account.insPremPyfPrdNum, pyfCodt, signTotalMoney, 
                		/*去除农行签约编号 add by huanghaokun 20210524 start*/
                		/*$scope.account.contractNo,*/ $scope.account.effectDate, $scope.account.period, 
                		/*去除农行签约编号 add by huanghaokun 20210524 end*/
                		$scope.account.signBusType, $scope.account.areaCode,'');
                //S2023103027791个人养老年金项目保全系统优化需求 update by huanghk 20231127 end
            };
            
            //签约请求成功的回调函数
                function successCallContract(response) {
                	myFactory.loadingHide();
                   // myFactory.goBack();
                
                   if (response.data.resultCode === 'R01' ){//签约处理成功！
                       //签约完毕后返回上一页面
                      $rootScope['isCon'+accountNo+itemId] = true;//全局参数，用来判断是否签约成功了，签约界面js会修改该参数的值为true
                      //$rootScope['conBank'+accountNo+itemId] = $scope.account.BankCode;//全局参数,用于返回上一步时，重新签约的银行与已签约的银行是否一致
                      myFactory.alert('提示','该账号银行签约成功！');
                       $timeout(function(){  	
                    	   //执行下一步
                    	   //02续期账号变更
                    	   if ( flag == '1' ){
                    		   var item = items['item'];
                    			   $ionicHistory.clearCache().then(function () {
                                       $state.go(nextAction, {
                                           itemId: itemId,
                                           item: item,
                                           chdrnum01: items['chdrnum01'],
                                           chdrcoy: items['chdrcoy']
                                       });
                                   })
                    
                            
                    	   }
                    	   //非实时缴费跳转过来的
                    	   if( flag == '2' ){
                    			$ionicHistory.clearCache().then(function(){ 
            						$state.go(nextAction,{
            							itemId:itemId,
            							chdrnum01: items['chdrnum01'],
                                        chdrcoy: items['chdrcoy'],
            							pageData:items['pageData'],
            							pageData2:items['pageData2'],
            							itemCommonList : items['itemCommonList'],
            						    strItemIds : items['strItemIds']
            						});
            						
            					})
                    	   }
                    	   
                    	   if (flag == '3'){
                    		   var pageData2 = items['pageData2'];
                    		   pageData2.mobile = $scope.account.mobile;
                    		   console.log("pageData2："+pageData2);
                    		   pays($scope.account.accountNo,pageData2);
                    	   }
                       },500);
                      
                   } else {
                	   myFactory.alert('提示！', response.data.resultMsg);
                	   countNum = countNum + 1 ;
                   }
                }
                //签约请求失败的回调函数
                function errorCallContract(response) {
                    	myFactory.loadingHide();
                        myFactory.alert('提示！','签约授权失败，请稍后重试！');
                }
                
    			function pays(bankacctkey,pageData2){
    			
    				var timestamp=myFactory.getTimetamp();
    				var sfis= "itemId-token-timestamp";
    				var signStr="itemId="+itemId+"&token="+token+"&timestamp="+timestamp;//encodeURI(name)
    				var sign = myFactory.hex(signStr);
    				

    				$("#ContractintimePayId").show();
    				$("#load_icon1Contract").show();//转动
    				$("#load_icon2Contract").hide();//暂停
    				$("#time_textContract").text("正等待对方银行返回结果...");
    				
    				$http({
    					method: 'GET',
    					url: app.domain + 'charge/restSave.action',
    					params: {'itemId': itemId,'chargeStr': pageData2,'sign':sign,'sfis':sfis,'token':token,'timestamp':timestamp}
    				}).then(function successCallback(response) {
    					if (response.data.success) {
    						var DataSave = response.data.data.pageData;
    						var nextStep= DataSave.nextStep;//"charge/restInit.action";
    						var message = DataSave.message;//用于检测实时缴费是否成功
    						var reqSn = DataSave.reqSn;//支付流水号
    						$rootScope['payFail'] = true;
    						//对缴费情况进行判断，如果失败，则提示相关内容，不再进行下一步操作
    						if(message == "" || message == 'fail'){
    							$("#load_icon1Contract").hide();//转动
    							$("#load_icon2Contract").show();//暂停
    							$("#time_textContract").text("本次转账失败，请选择其他缴费方式");
    							$.alert({title: '',text: '本次转账失败，请选择其他缴费方式',onOK: function () {
    					    				$rootScope['flag'] ='';
    										myFactory.goBack();
    							     }
    							});
    							return false;
    						}else if(message != "" && message == 'handle'){//处理中
    							//用延时控制比倒计时效果更好
    							var times=1;//等待15s后再调用
    							setTimeout(function() {
    								intimePayQuery(itemId,message,nextStep,pageData2,reqSn,times);//供给成功后使用参数itemId,message,nextStep
    							}, payRequestPerTime);
    						}else if(message != "" && message == 'timeout'){
    							$rootScope['payFail'] = true;
    							$("#load_icon1Contract").hide();//转动
    							$("#load_icon2Contract").show();//暂停
    							//$("#time_text").text("扣费处理中，请稍候，在结果返回前请勿关闭应用");
    							$("#time_textContract").text("接收方银行返回结果超时，请稍后再提交申请或通过受理台提交纸质申请，在结果返回前，请不要重复支付");
    							$.alert({title: '',text: '<div align="left" >接收方银行返回结果超时，请稍后提交申请或通过受理台提交纸质申请， <br /><span style=\'color:#e60012;font-size:15px;\'>在结果返回前，请不要重复支付</span></div>',onOK: function () {
    									$ionicHistory.clearCache().then(function(){
    										$state.go('search',{
    											index:'yes'
    										});
    									})
    							     }
    							});
    							return false;
    						}else if(message != "" && message == 'clntnumnull'){
    							//myFactory.alert('','支付失败！在线支付，获取的客户号为空，请重新支付','info');
    							$rootScope['payFail'] = true;
    							$("#load_icon1Contract").hide();//转动
    							$("#load_icon2Contract").show();//暂停
    							$("#time_textContract").text("支付失败！在线支付，获取的客户号为空，请重新支付");
    							$.alert({title: '',text: '支付失败！在线支付，获取的客户号为空，请重新支付',onOK: function () {
    					    		$rootScope['flag'] ='';
    								myFactory.goBack();
    							     }
    							});
    							return false;
    						}else if(message != "" && message == 'success'){ //成功时候才进行下一步操作
    							console.log("首次调用统一收付费平台-实时缴费返回结果："+message+"将进入intimePaySuccess()处理成功后调整逻辑");
    							intimePaySuccess(itemId,message,nextStep);
    						}
    					}else{
    						$rootScope['payFail'] = true;
    						$("#load_icon1Contract").hide();//转动
    						$("#load_icon2Contract").show();//暂停
    						$("#time_textContract").text("本次转账失败，请选择其他缴费方式.");
    						$.alert({title: '',text: '本次转账失败，请选择其他缴费方式',onOK: function () {
    				    			$rootScope['flag'] ='';
    								myFactory.goBack();
    						     }
    						});
    						return false;
    					}
    				}, function errorCallback(response) {
    					$rootScope['payFail'] = true;
    					$("#load_icon1Contract").hide();//转动
    					$("#load_icon2Contract").show();//暂停
    					$("#time_textContract").text("本次转账失败，请选择其他缴费方式。");
    					$.alert({title: '',text: '本次转账失败，请选择其他缴费方式。',onOK: function () {
    			    			$rootScope['flag'] ='';
    							myFactory.goBack();
    					     }
    					});
    					return false;
    				});
    			}
    			function intimePayQuery(itemId,message,nextStep,chargeData,reqSn,times){
    				console.log("开始调用支付查询接口 begin................第："+times+"次");
    				$("#time_textContract").html("接收对方银行返回结果有延时，尝试第<span style='color:#e60012;font-size:18px;'>"+times+"</span>次再查询");
    				
    				var timestamp=myFactory.getTimetamp();
    				var sfis= "reqSn-token-timestamp";
    				var signStr="reqSn="+reqSn+"&token="+token+"&timestamp="+timestamp;//encodeURI(tbrName)
    				var sign = myFactory.hex(signStr);
    				$http({
    					method: 'GET',
    					url: app.domain + 'charge/payQuery.action',
    					params: {'chargeStr': chargeData,'reqSn':reqSn,'queryTimes':times,'sign':sign,'sfis':sfis,'token':token,'timestamp':timestamp}
    				}).then(function successCallback(response) {
    					if (response.data.success) {
    						var message = response.data.data.message;
    						console.log("调用支付查询接口payQuery.action获取查询结果:"+message);
    						
    						//成功，结束一切操作，跳转地址
    						if(message != "" && message == 'success'){
    							console.log("首次调用统一收付费平台-实时缴费返回结果："+message+"将进入intimePaySuccess()处理成功后调整逻辑");
    							intimePaySuccess(itemId,message,nextStep);
    						}else if(message != "" && message == 'handle'){
    							console.log("支付成功还是处理中.....当前执行支付查询次数："+times);
    							if(times<payRequestTime){
    								times++;
    								setTimeout(function() {
    									intimePayQuery(itemId,message,nextStep,chargeData,reqSn,times);//供给成功后使用参数itemId,message,nextStep
    								}, payRequestPerTime);
    							}else{
    								console.log("查询支付接口超过次数限制:"+times);
    								console.log("payRequestTime次都是一样的支付状态，即将插入新表数据.....");
    								$("#load_icon1Contract").hide();//转动
    								$("#load_icon2Contract").show();//暂停
    								$("#time_textContract").text("接收方银行返回结果超时，请稍后再提交申请或通过受理台提交纸质申请，在结果返回前，请不要重复支付。");
    								$.alert({title: '',text: '<div align="left" >接收方银行返回结果超时，请稍后提交申请或通过受理台提交纸质申请， <br /><span style=\'color:#e60012;font-size:15px;\'>在结果返回前，请不要重复支付。</span></div>',onOK: function () {
    										$ionicHistory.clearCache().then(function(){
    											$state.go('search',{
    												index:'yes'
    											});
    										})
    								     }
    								});
    								return false;
    							}
    						}else if(message == "" || message == 'fail'){
    							$rootScope['payFail'] = true;
    							$("#load_icon1Contract").hide();//转动
    							$("#load_icon2Contract").show();//暂停
    							$("#time_textContract").text("本次转账失败，请选择其他缴费方式");
    							$.alert({title: '',text: '本次转账失败，请选择其他缴费方式',onOK: function () {
    					    		$rootScope['flag'] ='';
    								myFactory.goBack();
    							     }
    							});
    							return false;
    						}else{
    							$rootScope['payFail'] = true;
    							$("#load_icon1Contract").hide();//转动
    							$("#load_icon2Contract").show();//暂停
    							$("#time_textContract").text("本次转账失败，请选择其他缴费方式.");
    							$.alert({title: '',text: '本次转账失败，请选择其他缴费方式.',onOK: function () {
    					    		$rootScope['flag'] ='';
    								myFactory.goBack();
    							     }
    							});
    							return false;
    						}
    					}
    				}, function errorCallback(response) {
    					$rootScope['payFail'] = true;
    					 $("#load_icon1Contract").hide();//转动
    					 $("#load_icon2Contract").show();//暂停
    					 $("#time_textContract").text("本次转账失败,请选择其他缴费方式。");
    					 $.alert({title: '',text: '本次转账失败,请选择其他缴费方式。',onOK: function () {
    				    		$rootScope['flag'] ='';
    						 myFactory.goBack();
    					 }
    					 });
    					 return false;
    				});
    			}
    			
    			function intimePaySuccess(itemId,message,nextStep){
    				$("#time_textContract").text("支付成功");
    				console.log("支付成功.....停留2秒跳转签名页面");//跳转指定界面
    				$timeout(function() {
    					var timestamp=myFactory.getTimetamp();
    					var sfis= "itemId-message-token-timestamp";
    					var signStr="itemId="+itemId+"&message="+message+"&token="+token+"&timestamp="+timestamp;//encodeURI(name)
    					var sign = myFactory.hex(signStr);
    					//提交后台保存后，再次跳转到restInit.action，这次附带上检测标志的message
    					$http({
    						method: 'GET',
    						url: app.domain + nextStep,
    						params: {"itemId": itemId,"message":message,'sign':sign,'sfis':sfis,'token':token,'timestamp':timestamp}
    					}).then(function successCallback(response) {
    						if (response.data.success) {
    							var Data = response.data.data.pageData;
    							var charge = Data.charge;
    							var intime = Data.intime;
    							var messageMsg = Data.message;
    							var type = charge.type;
    							$rootScope['payFail'] = true;
    							//逻辑同check_mainCtrl,返回获取message结果，跳转签名
    							if(messageMsg!=undefined && messageMsg!=null && messageMsg!="" && messageMsg=="success" ){
    		
    									sfis= "itemId-token-timestamp";
        								signStr="itemId="+itemId+"&token="+token+"&timestamp="+timestamp;//encodeURI(name)
        								sign = myFactory.hex(signStr);
        								//如果是success这种情况，表示保存成功，直接跳转签名
        								//签名留影
        								$http({
        									method: 'GET',
        									url: app.domain + "img/gotoSignMain.action",
        									params: {"itemId": itemId,'sign':sign,'sfis':sfis,'token':token,'timestamp':timestamp}
        								}).then(function successCallback(response) {
        									if (response.data.success) {
        										var signMainData = response.data.data.signMainData;
        										if(signMainData!=undefined && signMainData!=null && signMainData!=""){
        											$ionicHistory.clearCache().then(function(){
        												$state.go('photo_sign',{
        													itemId:itemId,
        													chdrnum01:items['chdrnum01'],
        													chdrcoy:items['chdrcoy'],
        													signMainData:signMainData
        												});
        											});
        										}
        									}else{
        										myFactory.alert("","后台繁忙，请返回重新尝试!","info");
        							    		$rootScope['flag'] ='';
        										myFactory.goBack();
        									}
        									myFactory.loadingHide();
        								}, function errorCallback(response) {
        									myFactory.alert("","访问后台出错，请稍后再试!","info");
        						    		 $rootScope['flag'] ='';
        									_myFactory.goBack();
        								});
    		
    					
    							}
    						}else{
    							//myFactory.alert("","后台繁忙，请返回重新尝试!","info");
    							$rootScope['payFail'] = true;
    							 $("#load_icon1Contract").hide();//转动
    							 $("#load_icon2Contract").show();//暂停
    							 $("#time_textContract").text("本次转账失败，请选择其他缴费方式。");
    							 $.alert({title: '',text: '本次转账失败，请选择其他缴费方式。',onOK: function () {
    						    		$rootScope['flag'] ='';
    								    myFactory.goBack();
    							 }
    							 });
    						}
    					}, function errorCallback(response) {
    						myFactory.alert("","数据提交后台失败，请返回重新尝试!","info");
    			    		$rootScope['flag'] ='';
    						myFactory.goBack();
    					});
    				}, 2000);
    			}
                
                
        }]);
    
     //指针弹窗
     app.directive('infoid',function(){
         return {
             restrict: 'EA',		//指明指令在DOM里面以什么形式被声明,EA.表示即可以是元素也可以是属性
             templateUrl: 'html/input/content_base_info.html'+app.clearCache,
             replace: true,		//设置解析后，DOM声明的指令是否消失
             link: function(scope,element,attrs){  //链接函数负责注册DOM事件和更新DOM,
                 console.log('指令完成');
             }
         }
     });
})(app);